//
//  UITableView+NULLABL.m
//  ChatForHot
//
//  Created by FLY on 2018/10/16.
//  Copyright © 2018年 FLY. All rights reserved.
//

#import "UITableView+NULLABL.h"
#import <objc/runtime.h>
@implementation UITableView (NULLABL)

- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event{
    if (self.isNullAbl) {
        CGRect rect = [self.tableHeaderView convertRect:self.tableHeaderView.frame fromView:self];
        if (CGRectContainsPoint(rect, point)) {
            return NO;
        }
    }
    
    return [super pointInside:point withEvent:event];
}

- (void)setIsNullAbl:(BOOL)isNullAbl{
    objc_setAssociatedObject(self, @"isNullAbl", [NSNumber numberWithBool:isNullAbl], OBJC_ASSOCIATION_RETAIN);
}
- (BOOL)isNullAbl{
    NSNumber *number = objc_getAssociatedObject(self, @"isNullAbl");
    return number.boolValue;
}

@end
